package com.codejiwei.metastore;

import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

/**
 * Author: jiwei01
 * Date: 2023/3/17 11:22
 * Package: com.codejiwei.metastore
 * Description:
 */
public class MetadataTest {

    public static void main(String[] args) {
//        String table = "hive";
//
//        System.out.println(TaskStorageEnum.HIVE.name());
//        System.out.println(TaskStorageEnum.HIVE);
//        System.out.println(TaskStorageEnum.valueOf("HIVE"));
//        System.out.println(TaskStorageEnum.HIVE.getName());
//        System.out.println(TaskStorageEnum.HIVE.ordinal());
//
//        String dbName = "meta_store";
//        String storage = "storage";
//        Integer tableId = 11;
//        String sql = String.format("select name, version, properties from %s.%s where table_id = %d;", dbName, storage, tableId);
//        System.out.println(sql);

//        TestA a = new TestA("tom");
//        System.out.println(a);
//        setName(a, "jerry");
//
//        System.out.println(a);
//        System.out.println(a.getName());
//
////        LocalDateTime localDateTime = new LocalDateTime();
//        Date date = new Date();
//        System.out.println(date);

//        List<TableFieldEntity> fields = new ArrayList<>();
//        TableStorageEntity storage = new TableStorageEntity();
//
//        TableInfo.Info info = new TableInfo.Info(fields, storage);
//        TableInfo tableInfo = new TableInfo("env", "db", "table", info);
//        tableInfo.setDatabase("database");
//
//        System.out.println(tableInfo);
//
//
////        setDorisPartitionsEntryV1(tableInfo.info.storage);
//        System.out.println(tableInfo);

        List<String> strings = new ArrayList<>();
        strings.add("aaa");
        strings.add("bbb");
        strings.add("ccc");

        List<String> aa = strings.stream().filter(x -> x.equals("aaa")).collect(Collectors.toList());
        System.out.println(aa);


        String s = "aaaa";
        byte[] bytes = s.getBytes(StandardCharsets.UTF_8);


    }

    public static TableStorageEntity setDorisPartitionsEntry(TableStorageEntity entity) {
        TableStorageEntity tableStorageEntity = new TableStorageEntity();
        tableStorageEntity.name = "Doris";
//        entity.setName("Doris");
        return tableStorageEntity;
    }

//    public static void setDorisPartitionsEntryV1(TableStorageEntity entity) {
//        entity.name = "Hive";
//        Map<String, Object> partitions = new HashMap<>();
//        partitions.put("t_partitions", "t1");
//        partitions.put("f_partitions", "f1");
//        entity.properties.
//        entity.properties.put("partitions", partitions);
//    }




}
